{% extends "./layout/layout.html" %}

{#  引入宏  #}
{% import './macros/blog-list.html' as list %}
{% import './macros/loadMore.html' as loadBtn %}
{% import './macros/user-info.html' as user %}
{% import './macros/fans.html' as fans %}
{% import './macros/follower.html' as follower %}
{% import './macros/input.html' as inputTag %}

{% block headCss%}
<link rel="stylesheet" href="/css/home.css">
{% endblock %}

{% block content %}
<!-- <h1>栅格系统，竖向分成12格</h1> -->
<div class="container">
  <div class="row">
    <!-- 左侧 -->
    <div class="col-lg-8 left">
      <!-- 发表博客的文本框 -->
      {{ inputTag.input() }}

      <!-- 博客列表 -->
      <div class="item-wrapper">

        {% if blogList.length > 0 %}
        {{ list.list(blogList, isCanReply = true) }}
        {% else %}
        <p>暂无数据</p>
        {% endif %}

      </div>
      <!-- 加载更多 -->
      {{ loadBtn.loadMore(
        pageIndex,
        pageSize,
        count,
        isCanReply=true,
        api = '/api/blog/loadHomeBlogMore/'
      ) }}
    </div>


    <!-- 右侧 -->
    <div class="col-lg-4 right">
      <!-- 个人信息 -->
      {{ user.userInfo(
        user = userData.userInfo,
        isMe = userData.isMe,
        isMeFollow = userData.isMeFollow,
        atCount = userData.atCount
      ) }}
      <hr>
      <!-- 关注列表 -->
      {{ follower.showFollower(
        count = userData.followData.count,
        userList = userData.followData.followList
      ) }}
      <hr>
      <!-- 粉丝列表 -->
      {{ fans.showFans(
        count = userData.fansData.count,
        userList = userData.fansData.fansList
      ) }}
    </div>
  </div>
</div>

{% endblock %}

{% block js %}
<script>

</script>
{% endblock %}